const Koa = require('koa')
const app = new Koa()

routers.forEach(router => {
  app.use(router.routers(), router.allowedMethods())
})

fs.readdirSync(path.resolve(__dirname, './routes')).forEach(file => {
  const route = require(path.resolve(__dirname, `./routes/${file}`)).default;
  app.use(route.routes()).use(route.allowedMethods());
});

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000')
})